resource "aws_lb_target_group"
code:例.tf
resource "aws_lb_target_group" "asg" {
name = "terraform-asg-example"
port = var.server_port
protocol = "HTTP"
vpc_id = data.aws_vpc.default.id
health_check {
path = "/"
protocol = "HTTP"
matcher = "200"
interval = 15
timeout = 3
healthy_threshold = 2
unhealthy_threshold = 2
}
}
これ↑でtarget groupを宣言して、別リソースからこれを参照する
code:tf
resource "aws_autoscaling_group" "example" {
health_check_type = "ELB"
...
}
参照の向きそっちなんだmrsekut.icon
Target Group → Targetじゃなくて
Target Group ← Targetなんだ